package com.pro.controller;

import com.pro.pojo.JsClosure;
import com.pro.pojo.JsCourse;
import com.pro.pojo.JsonData;
import com.pro.service.JsBeforeUserShutDownLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:JsBeforeUserShutDownLogController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2022/1/24 19:53
 * @Author: XJR
 */
@RequestMapping("/jsBeforeShutDown")
@RestController
public class JsBeforeUserShutDownLogController {

    @Autowired
    private JsBeforeUserShutDownLogService service;

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/24
     * @Content:前端用户封停日志列表
     */
    @RequestMapping("/selectBeforeShutDownLog")
    public JsonData selectBeforeShutDownLog(String account,String reason,Integer type,Integer limit,Integer page){
        List<JsClosure> jsClosures = service.selectBeforeShutDownLog(account, reason,type,limit,page);
        Integer count = service.countBeforeShutDownLog(account, reason,type);
        return jsClosures!=null?JsonData.buildSuccess(jsClosures,count):JsonData.buildError("服务器发生错误");
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/25
     * @Content:前端用户解封日志列表
     */
    @RequestMapping("/selectBeforeUnsealLog")
    public JsonData selectBeforeUnsealLog(String account,String reason,Integer type,Integer limit,Integer page){
        List<JsCourse> jsCourses = service.selectBeforeUnsealLog(account, reason,type,limit,page);
        Integer count = service.countBeforeUnsealLog(account, reason,type);
        return jsCourses!=null?JsonData.buildSuccess(jsCourses,count):JsonData.buildError("服务器发生错误");
    };
}
